<?php
use yii\bootstrap\ActiveForm;
?>
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/app/goods-keyword/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/app/goods-keyword/css/jquery.dropdown.css">
<style>
.dataTables_length {
	margin-top: 10px;
}

.dataTable>tbody>tr>td {
	vertical-align: middle;
	font-size: 0.8em;
	padding: 8px 18px;
}

.dataTable>thead>tr>th {
	vertical-align: middle;
	font-size: 0.8em;
}

.source_type_class {
	min-height: 20px;
	padding-left: 20px;
	margin-bottom: 0;
	font-weight: 400;
	cursor: pointer;
}
.form-left{
    border-right: 1px solid #dddddd;
}

.examine-content{
    width: 1000px;
	margin-left:-300px;
}
.examine-content .input-group .form-control{
    margin-bottom: 20px;
    height: 30px ;
    line-height: 30px;
}
.examine-content button{
    margin: 10px;
}
#table_id_example th, td {
	white-space: nowrap;
}
</style>
<div class="tabs-panel">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					商品名称:	<input class="depart-input" name="search_goods_name_cn" id="search_goods_name_cn" type="text" placeholder="">
					物料号:	<input class="depart-input" name="goods_sku" id="goods_sku" type="text" placeholder="">
					<label>审核状态：</label>
                    <select id="is_examine" name="is_examine" class="depart-input" style="width: 150px">
                        <option value="">全部</option>
                        <?php if (is_array($GLOBALS['_GOODS_EXAMINE_STATUS']) && count($GLOBALS['_GOODS_EXAMINE_STATUS']) > 0)foreach($GLOBALS['_GOODS_EXAMINE_STATUS'] as $key=>$value){?>
                            <option value="<?=$key?>" <?=($key == 1 ? 'selected' : '')?>><?=$value?></option>
                        <?php }?>
                    </select>&nbsp;
					<button type="button" class="btn btn-primary depart-modal" id="select_button" style="width: 100px;">查询</button>
					&nbsp;
					<button type="button" class="btn btn-warning depart-modal" id="reset_button" style="width: 100px;">重置</button>
				</div>
				<div class="box-body">
					<a type="button" class="btn btn-success depart-modal" href="/goods/get-main-goods-detail" style="width: 100px;">添加</a>
					<button type="button" class="btn btn-success depart-modal" id="publish_button" style="width: 100px;">同步商品</button>
					<!-- <button type="button" class="btn btn-success depart-modal" id="batch_grounding" style="width: 100px;">批量上架</button>
					<button type="button" class="btn btn-success depart-modal" id="batch_undercarriage" style="width: 100px;">批量上架</button> -->
					<table id="table_id_example" class="display">
						<thead>
							<tr>
								<th style="width: 10%">操作</th>
								<th style="width: 5%"><input id="checked_all" type="checkbox" >商品ID</th>
								<th style="width: 5%">主商品号</th>
								<th style="width: 10%">商品名称</th>
								<th style="width: 10%">一级分类</th>
								<th style="width: 10%">二级分类</th>
								<th style="width: 10%">商品品类</th>
								<th style="width: 10%">商品品牌</th>
								<th style="width: 5%">排序</th>
								<th style="width: 10%">商品搭配</th>
								<th style="width: 5%"><?=TITLE_STATUS?></th>
								<th style="width: 5%">审核状态</th>
								<th style="width: 5%">操作日志</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="add-main-goods-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel_goods">添加商品</h4>
			</div>
			<div class="modal-body">
                <?php
                $form = ActiveForm::begin([
                    'id' => 'add_main_goods_form',
                    'action' => ['/goods/add-main-goods']
                ]);
                ?>
                <div class="box-body">
					<div class="form-group">
						<label for="mobile">商品中文名称</label>
						<input type="text" style="width: 50%;" class="form-control" name="goods_name_cn" id="add_goods_name_cn" placeholder="商品中文名称">
					</div>

					<div class="form-group">
						<label for="mobile">商品其他名称</label>
						<input type="text" style="width: 50%;" class="form-control" name="goods_name_other" id="add_goods_name_other" placeholder="商品其他名称">
					</div>
					<div class="form-group">
						<label for="exampleInputEmail1">商品分类</label> <select
							id="add_category_step1" name="category_step1"
							class="form-control" style="width: 50%;">
							<option value="0">选择商品一级分类</option>
                            <?php foreach($category_list as $value){?>
                                <option value="<?= $value['id']?>"><?= $value['category_name']?></option>
                            <?php }?>
                        </select> <select id="add_category_step2"
							name="category_step2" class="form-control"
							style="width: 50%; margin-top: 10px;">
							<option value="0">选择商品二级分类</option>
						</select>
					</div>
					<div class="form-group">
						<label for="exampleInputEmail1">商品品类</label> <select
							id="add_tag_id" name="tag_id" class="form-control"
							style="width: 50%;">
							<option value="0">选择商品品类</option>
						</select>
					</div>
					<div class="form-group">
						<label for="exampleInputEmail1">商品品牌</label> <select
							id="add_brand_id" name="brand_id" class="form-control"
							style="width: 50%;">
							<option value="0">选择商品品牌</option>
						</select>
					</div>
					<div class="form-group">
						<button type="button"
							class="btn btn-success depart-modal upload-img-btn-main-pic"
							style="width: 110px;">上传商品主图</button>
						<button style="display: none;" data-img="" type="button"
							class="btn btn-success depart-modal show-img-btn-main-pic"
							style="width: 110px;">查看图片</button>
						<input name="goods_main_pic" id="add_goods_main_pic" type="hidden">
					</div>

					<div class="form-group">
						<label for="mobile">图片title</label> <input type="text"
							style="width: 50%;" class="form-control" name="goods_pic_title"
							id="add_goods_pic_title" placeholder="图片title">
					</div>

					<div class="form-group">
						<label for="mobile">图片alt</label> <input type="text"
							style="width: 50%;" class="form-control" name="goods_pic_alt"
							id="add_goods_pic_alt" placeholder="图片alt">
					</div>

					<div class="form-group">
						<label for="mobile">关键字</label><br />
						<button type="button" class="btn btn-success depart-modal"
							id="add_input_keyword" style="width: 100px;">添加</button>
						<table class="table table-hover" id="input_table_keyword">
							<tr>
								<th>关键字</th>
								<th>操作</th>
							</tr>
						</table>
					</div>

					<div class="form-group">
						<label for="exampleInputEmail1">价格单位</label>
						<select id="add_unit" name="unit" class="form-control" style="width: 50%;">
							<option value="CNY">CNY</option>
							<option value="$">$</option>
							<option value="¥">¥</option>
						</select>
					</div>

					<div class="form-group">
						<label for="mobile">排序</label> <input type="text"
							style="width: 50%;" class="form-control" name="sort"
							id="add_sort" placeholder="排序">
					</div>
					
					 <div class="form-group">
						<label for="exampleInputEmail1">状态</label>
						<select id="use_flg" name="use_flg" class="form-control" style="width: 50%;">
							<option value="1">上架</option>
							<option value="0">下架</option>
							<option value="2">售罄</option>
						</select>
					</div>

					<div class="form-group">
						<label for="exampleInputPassword1">商品中文描述</label>
						<!--                         <textarea class="form-control ckeditor" name="brief_cn" id="add_brief_cn" placeholder="" ></textarea> -->
						<textarea class="form-control xheditor" name="brief_cn"
							id="add_brief_cn" placeholder="" style="width: 100%;"></textarea>
					</div>

					<div class="form-group">
						<label for="exampleInputPassword1">商品其他描述</label>
						<!--                         <textarea class="form-control ckeditor" name="brief_other" id="add_brief_other" placeholder="" ></textarea> -->
						<textarea class="form-control xheditor" name="brief_other"
							id="add_brief_other" placeholder="" style="width: 100%;"></textarea>
					</div>
				</div>

				<input name="add_main_id" id="add_main_id" type="hidden"> <input
					name="add_main_goods_id" id="add_main_goods_id" type="hidden">
				<!-- /.box-body -->

                <?php ActiveForm::end(); ?>
            </div>

			<div style="display: none">
                <?php $form = ActiveForm::begin(['id'=>'upload_goods_main_pic','action'=>'/common/img-upload'],['options' => ['enctype' => 'multipart/form-data']]) ?>
                <?= $form->field($model, 'img_url')->fileInput(['class' => 'upload_file_goods_main_pic']) ?>
                <?php ActiveForm::end() ?>
            </div>

			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭
				</button>
				<a type="button" class="btn btn-primary ajax_post_add_goods"> 提交 </a>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="examine-goods" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<input name="goods_list_edit_id" id="goods_list_edit_id" type="hidden"/> 
	<div class="modal-dialog">
		<div class="modal-content examine-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="examine_myModalLabel_goods">审核商品</h4>
			</div>
			<div class="modal-body">
    			<div class="row">
    				<div class="col-md-6 form-left">
    					<form id="examine_goods_form">
                            <div class="box-body">
            					<div class="form-group">
            						<label for="mobile">商品中文名称</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" id="examine_goods_name_cn" name="goods_name_cn" placeholder="商品中文名称">
            					</div>
            					<div class="form-group">
            						<label for="mobile">商品其他名称</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" id="examine_goods_name_other" name="goods_name_other" placeholder="商品其他名称">
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1">商品分类</label>
            						<select id="examine_category_step1" disabled name="category_step1" class="form-control" style="width: 50%;">
            							<option value="0">选择商品一级分类</option>
                                        <?php if (is_array($category_list) && count($category_list) > 0)foreach($category_list as $value){?>
                                       	<option value="<?= $value['id']?>"><?= $value['category_name']?></option>
                                        <?php }?>
                                    </select>
                                    <select id="examine_category_step2" disabled name="category_step2" class="form-control" style="width: 50%; margin-top: 10px;">
            							<option value="0">选择商品二级分类</option>
            						</select>
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1">商品品类</label> 
            						<select id="examine_tag_id" name="tag_id" disabled class="form-control" style="width: 50%;">
            							<option value="0">选择商品品类</option>
            						</select>
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1">商品品牌</label>
            						<select id="examine_brand_id" name="brand_id" disabled class="form-control" style="width: 50%;">
            							<option value="0">选择商品品牌</option>
            						</select>
            					</div>
            					<!-- mod by lizenan 20180119 【后台需求】关键词维护改进   430  start -->
            					<div class="form-group">
            						<label for="exampleInputEmail1">系列号</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="series" id="examine_series" placeholder="系列号">
            					</div>
            					<!-- mod by lizenan 20180119 【后台需求】关键词维护改进   430  end -->
            					<div class="form-group">
            						<button style="display: none;" data-img="" type="button" class="btn btn-success depart-modal show-img-btn-examine-pic" style="width: 110px;">查看图片</button>
            						<input name="goods_main_pic" id="examine_goods_main_pic" type="hidden">
            					</div>
            					<div class="form-group">
            						<label for="mobile">图片title</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="goods_pic_title" id="examine_goods_pic_title" placeholder="图片title">
            					</div>
            
            					<div class="form-group">
            						<label for="mobile">图片alt</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="goods_pic_alt" id="examine_goods_pic_alt" placeholder="图片alt">
            					</div>
            
            					<div class="form-group">
            						<label for="mobile">关键字</label><br />
            						<table class="table table-hover" id="examine_input_table_keyword">
            							<tr>
            								<th>关键字</th>
            							</tr>
            						</table>
            					</div>
            					<div class="form-group">
            						<label for="mobile">导航分类展示</label><br />
            						<div class="col-md-12" style="margin-bottom: 10px;" id="examine_navigation_identification">
            						</div>
            					</div>
            
            					<div class="form-group">
            						<label for="exampleInputEmail1">价格单位</label>
            						<select id="examine_unit" name="unit" disabled class="form-control" style="width: 50%;">
            							<option value="CNY">CNY</option>
            							<option value="$">$</option>
										<option value="¥">¥</option>
            						</select>
            					</div>
            
            					<div class="form-group">
            						<label for="mobile">排序</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="sort" id="examine_sort" placeholder="排序">
            					</div>
            					
             					<div class="form-group">
             						<label for="exampleInputEmail1">商品详情页价格描述</label>
             						<select id="examine_hidden_price" name="hidden_price" disabled class="form-control" style="width: 50%;">
            							<option value="0">请选择</option>
            							<option value="1">价格展示文字：请咨询客服</option>
            							<option value="2">市场价后加“起”</option>
            							<option value="3">销售价后加“起”</option>
            							<option value="4">市场价和销售价后都加“起”</option>
            						</select>
            						<!--<input type="checkbox" disabled style="width:20px;height:20px;float:left" name="hidden_price" id="examine_hidden_price">&nbsp;
            						<label for="mobile">商品详情页价格展示文字：请咨询客服</label> -->
            					</div>
            					<!-- add by lizenan 20180129 【商城需求】商品详情页增加查看同品牌商品的按钮   488  start -->
            					<div class="form-group">
            						<input type="checkbox" disabled style="width:20px;height:20px;float:left" name="see_more_product" id="examine_see_more_product">&nbsp;
            						<label for="mobile">商品详情页展示查看更多同品牌商品</label>
            					</div>
            					<!-- add by lizenan 20180129 【商城需求】商品详情页增加查看同品牌商品的按钮   488  end -->
            					<div class="form-group">
            						<label for="exampleInputEmail1">状态</label>
									<select id="examine_use_flg" disabled name="use_flg" class="form-control" style="width: 50%;">
            							<option value="1">上架</option>
            							<option value="0">下架</option>
            							<option value="2">售罄</option>
            						</select>
            					</div>
            					<!-- <div class="form-group">
            						<label for="exampleInputEmail1">商品标识</label>
									<select id="examine_goods_identification" disabled name="goods_identification" class="form-control" style="width: 50%;">
            							<option value="">请选择</option>
            							<?php //if (is_array($goods_identification) && count($goods_identification) > 0)foreach($goods_identification as $value){?>
                                       	<option value="<?php //$value['id']?>"><?php //$value['name']?></option>
                                        <?php //}?>
            						</select>
            					</div> -->
            
            					<div class="form-group">
            						<label for="exampleInputPassword1">商品中文描述</label>
            						<textarea class="form-control xheditor" name="brief_cn" id="examine_brief_cn" placeholder="" style="width: 100%;"></textarea>
            					</div>
            
            					<div class="form-group">
            						<label for="exampleInputPassword1">商品其他描述</label>
            						<textarea class="form-control xheditor" name="brief_other" id="examine_brief_other" placeholder="" style="width: 100%;"></textarea>
            					</div>
            				</div>
                    	</form>
    				</div>
    				<div class="col-md-6 form-right">
    					<form action="/goods/examine-goods" id="examine_goods_form_2">
                            <div class="box-body">
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原商品中文名称</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" id="examine_goods_name_cn_2" name="goods_name_cn">
            					</div>
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原商品其他名称</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" id="examine_goods_name_other_2" name="goods_name_other">
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1" class="text-danger">原商品分类</label>
            						<select id="examine_category_step1_2" disabled name="category_step1" class="form-control" style="width: 50%;">
         
                                        <?php foreach($category_list as $value){?>
                                       	<option value="<?= $value['id']?>"><?= $value['category_name']?></option>
                                        <?php }?>
                                    </select>
                                    <select id="examine_category_step2_2" disabled name="category_step2" class="form-control" style="width: 50%; margin-top: 10px;">
            						</select>
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1" class="text-danger">原商品品类</label> 
            						<select id="examine_tag_id_2" name="tag_id" disabled class="form-control" style="width: 50%;">
            							<option value="0">选择商品品类</option>
            						</select>
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1" class="text-danger">原商品品牌</label>
            						<select id="examine_brand_id_2" name="brand_id" disabled class="form-control" style="width: 50%;">
            							<option value="0">选择商品品牌</option>
            						</select>
            					</div>
            					<!-- mod by lizenan 20180119 【后台需求】关键词维护改进   430  start -->
            					<div class="form-group">
            						<label for="exampleInputEmail1">原系列号</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="series" id="examine_series_2" placeholder="系列号">
            					</div>
            					<!-- mod by lizenan 20180119 【后台需求】关键词维护改进   430  end -->
            					<div class="form-group">
            						<button data-img="" type="button" class="btn btn-primary depart-modal show-img-btn-examine-pic_2" style="width: 110px;">查看原图片</button>
            						<input name="goods_main_pic" id="examine_goods_main_pic_2" type="hidden">
            					</div>
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原图片title</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="goods_pic_title" id="examine_goods_pic_title_2" placeholder="图片title">
            					</div>
            
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原图片alt</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="goods_pic_alt" id="examine_goods_pic_alt_2" placeholder="图片alt">
            					</div>
            
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原关键字</label><br />
            						<table class="table table-hover" id="examine_input_table_keyword_2">
            							<tr>
            								<th>关键字</th>
            							</tr>
            						</table>
            					</div>
            					<div class="form-group">
            						<label for="mobile">原导航分类展示</label><br />
            						<div class="col-md-12" style="margin-bottom: 10px;" id="examine_navigation_identification_2">
            						</div>
            					</div>
            					<div class="form-group">
            						<label for="exampleInputEmail1" class="text-danger">原价格单位</label>
            						<select id="examine_unit_2" name="unit" disabled class="form-control" style="width: 50%;">
										<option value="CNY">CNY</option>
										<option value="$">$</option>
										<option value="¥">¥</option>
            						</select>
            					</div>
            
            					<div class="form-group">
            						<label for="mobile" class="text-danger">原排序</label>
            						<input type="text" style="width: 50%;" disabled class="form-control" name="sort" id="examine_sort_2" placeholder="排序">
            					</div>
            					
            					<div class="form-group">
            						<!--<input type="checkbox" disabled style="width:20px;height:20px;float:left" name="hidden_price" id="examine_hidden_price_2">&nbsp;
             						<label for="mobile">商品详情页价格展示文字：请咨询客服</label> -->
									<label for="exampleInputEmail1">商品详情页价格描述</label>
             						<select id="examine_hidden_price_2" disabled name="hidden_price" class="form-control" style="width: 50%;">
            							<option value="0">请选择</option>
            							<option value="1">价格展示文字：请咨询客服</option>
            							<option value="2">市场价后加“起”</option>
            							<option value="3">销售价后加“起”</option>
            							<option value="4">市场价和销售价后都加“起”</option>
            						</select>
            					</div>
            					
            					<!-- add by lizenan 20180129 【商城需求】商品详情页增加查看同品牌商品的按钮   488  start -->
            					<div class="form-group">
            						<input type="checkbox" disabled style="width:20px;height:20px;float:left" name="see_more_product" id="examine_see_more_product_2">&nbsp;
            						<label for="mobile">商品详情页展示查看更多同品牌商品</label>
            					</div>
            					<!-- add by lizenan 20180129 【商城需求】商品详情页增加查看同品牌商品的按钮   488  end -->
            					
            					<div class="form-group">
            						<label for="exampleInputEmail1">原状态</label>
									<select id="examine_use_flg_2" disabled name="use_flg" class="form-control" style="width: 50%;">
            							<option value="1">上架</option>
            							<option value="0">下架</option>
            							<option value="2">售罄</option>
            						</select>
            					</div>
            					<!-- <div class="form-group">
            						<label for="exampleInputEmail1">原商品标识</label>
									<select id="examine_goods_identification_2" disabled name="goods_identification" class="form-control" style="width: 50%;">
            							<option value="">请选择</option>
            							<?php //if (is_array($goods_identification) && count($goods_identification) > 0)foreach($goods_identification as $value){?>
                                       	<option value="<?php //$value['id']?>"><?php //$value['name']?></option>
                                        <?php //}?>
            						</select>
            					</div> -->
            					<div class="form-group">
            						<label for="exampleInputPassword1" class="text-danger">原商品中文描述</label>
            						<textarea class="form-control xheditor" name="brief_cn" id="examine_brief_cn_2" placeholder="" style="width: 100%;"></textarea>
            					</div>
            
            					<div class="form-group">
            						<label for="exampleInputPassword1" class="text-danger">原商品其他描述</label>
            						<textarea class="form-control xheditor" name="brief_other" id="examine_brief_other_2" placeholder="" style="width: 100%;"></textarea>
            					</div>
            				</div>
                    	</form>
    				</div>
    				<div class="col-md-12">
                        <div class="col-md-1"></div>
                        <div class="col-md-10">
                        	<button class="btn col-md-3" style="color:#fff;background-color:#df13cd;border-color:#EE00EE" onclick="goodsPreview(this,1)">预览</button>
                            <button class="btn btn-warning col-md-3" onclick="changeExamineStatus(3)">核退</button>
                            <button class="btn btn-primary col-md-3" onclick="changeExamineStatus(2)">核准</button>
                        </div>
                        <div class="col-md-1"></div>
                    </div>
    			</div>
            </div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="add-spec-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:80%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">选择商品规格</h4>
			</div>
			<div class="modal-body">
                <?php $form = ActiveForm::begin(['id' => 'add_sku_form','action' => ['/goods/add-sku']]);?>
                <div class="box-body">
                	<input class="form-control search_spec" style="width:50%;float:left" placeholder="搜索规格" type="text">&nbsp;
					<button type="button" class="btn btn-warning depart-modal" onclick="removeSpecClass()" style="width: 100px;">重置</button>
                </div>
				<div class="box-body">
					<div class="nav-tabs-custom">
						<ul class="nav nav-tabs">
                            <?php foreach($spec_group_list as $key=>$value){?>
                                <?php if($key == 0){?>
                                    <li class="active">
                                <?php }else{?>
							<li class="">
                                <?php }?>
                                <a href="#fa-icons-<?= $value['id']?>"
								data-toggle="tab"><?= $value['spec_group_name']?></a>
							</li>
                            <?php }?>
                        </ul>
						<div class="tab-content">
                            <?php foreach($spec_group_list as $key=>$value){?>
                            <?php if($key == 0){?>
                            <div class="tab-pane active" id="fa-icons-<?= $value['id']?>">
                          	<?php }else{?>
                                <div class="tab-pane" id="fa-icons-<?= $value['id']?>">
                            <?php }?>
                            <?php if(empty($value['child_list'])){?>
                            <?php }else{?>
                            	<?php foreach($value['child_list'] as $val){?>
                            		<div style="width:50%;float:left">
                               		<?php if($value['spec_type'] == 0){?>
                                        <label for="spec_id_<?= $val['id']?>">
                                        <input id="spec_id_<?= $val['id']?>" name="other_spec_id[]" data-type="3" class="spec-class" type="checkbox" value="<?= $val['id']?>"><?= $val['spec_val']?>
                                        </label>
                                    <?php }elseif($value['spec_type'] == 1){?>
                                        <label for="spec_id_<?= $val['id']?>">
                                        <input id="spec_id_<?= $val['id']?>" name="color_spec_id[]" data-type="2" class="spec-class" type="checkbox" value="<?= $val['id']?>"><?= $val['spec_val']?>
                                        </label>
                                        <input id="spec_title_<?= $val['id']?>" class="hide" disabled name="color_spec_title[]" style="width:50%" type="text" value="">
                                        <button type="button" class="btn btn-success depart-modal upload-color-pic hide" style="width: 120px;">上传颜色图片</button>
                                        <button style="" data-img="" type="button" class="btn btn-success depart-modal hide show-color-pic">查看图片</button>
                                    <?php }elseif($value['spec_type'] == 2){?>
                                    	<label for="spec_id_<?= $val['id']?>">
                                        <input id="spec_id_<?= $val['id']?>" name="size_spec_id[]" data-type="1" class="spec-class" type="checkbox" value="<?= $val['id']?>"><?= $val['spec_val']?>
                                        </label>
                                    <?php }?>
                                    </div>
                                <?php }?>
                                <div style="width:50%">
                                        <span style="font-size:1px;">.</span>
                                </div>
                            <?php }?>
                        </div>
                        <?php }?>
                            </div>
						</div>
						<input type="hidden" name="add_main_id" id="add_sku_main_id">
						<input type="hidden" name="old_other_spec_id" id="old_other_spec_id">
						<input type="hidden" name="old_color_spec_id" id="old_color_spec_id">
						<input type="hidden" name="old_size_spec_id" id="old_size_spec_id">
					</div>
                <?php ActiveForm::end(); ?>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭
					</button>
					<a type="button" class="btn btn-primary ajax_post_add_goods_sku">
						提交 </a>
				</div>
			</div>
			
			<div style="display: none">
                <?php $form = ActiveForm::begin(['id'=>'upload_spec_color_pic','action'=>'/common/img-upload'],['options' => ['enctype' => 'multipart/form-data']]) ?>
                <?= $form->field($model, 'img_url')->fileInput(['class' => 'upload_color_pic']) ?>
                <?php ActiveForm::end() ?>
            </div>
		</div>
	</div>
</div>

<div class="modal fade" id="show-sku-modal"
	style="background: rgba(236, 230, 230, 0.3);" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 90%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">商品列表</h4>
			</div>
			<div class="modal-body">
				<div class="box-header">
					<!--<h3 class="box-title">Hover Data Table</h3>-->
					物料号: <input class="depart-input" name="search_goods_sku"
						id="search_goods_sku" type="text" placeholder=""> <input
						class="depart-input" name="select_goods_id" id="select_goods_id"
						type="hidden" value="0">
					<button type="button" class="btn btn-primary depart-modal"
						id="select_goods_button" style="width: 100px;">查询</button>
					&nbsp;
					<button type="button" class="btn btn-warning depart-modal"
						id="reset_goods_button" style="width: 100px;">重置</button>
					&nbsp;
					<button type="button" class="btn btn-success depart-modal"
						id="add_goods_sku_button" style="width: 100px;">新增子商品</button>
					<!--部门:<select name="dept_id" id="dept_id"></select>-->
				</div>
				<!-- /.box-header -->
				<div class="box-body">
					<table id="goods_id_example" class="display">
						<thead>
							<tr>
								<th style="width: 30%">操作</th>
								<th>ID</th>
								<th>商品名称</th>
								<th>商品号</th>
								<th>物料号</th>
								<th>规格</th>
								<th>颜色</th>
								<th>排序</th>
								<th>状态</th>
								<th><?=TITLE_STATUS?></th>
								<th>审核状态</th>
								<th>删除</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭
				</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal -->
</div>

<div class="modal fade" id="update-sku-modal"
	style="background: rgba(236, 230, 230, 0.3);" tabindex="-1"
	role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 40%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="myModalLabel">规格详情</h4>
			</div>
			<div class="modal-body">
                <?php
                    
$form = ActiveForm::begin([
                        'id' => 'update_sku_form',
                        'action' => [
                            '/goods/update-goods-sku'
                        ]
                    ]);
                    ?>
                    <input name="spec_val" type="hidden"/>
                    <input name="spec_color_val" type="hidden"/>
                    <input name="goods_list_id" type="hidden"/>
                <div class="box-body">
					<div class="form-group">
						<label for="mobile">商品名称</label> <input type="text"
							style="width: 50%;" readonly="readonly" class="form-control"
							name="goods_name_cn" id="update_goods_name_cn"
							placeholder="商品名称">
					</div>

					<div class="form-group">
						<label for="mobile"><span class="text-danger">* </span>设为主商品</label>
						<div class="radio">
							<label> <input type="radio" name="is_main" class="is_main_class"
								value="1"> 是
							</label> <label> <input type="radio" name="is_main"
								class="is_main_class" value="0" checked> 否
							</label>
						</div>
					</div>

					<div class="form-group">
						<label for="mobile"><span class="text-danger">* </span>物料号</label> <input type="text"
							style="width: 50%;" class="form-control" name="sku"
							id="update_sku" placeholder="物料号">
					</div>

					<div class="form-group">
						<button type="button" class="btn btn-success depart-modal"
							id="add_input" style="width: 100px;">添加</button>
						<label class="source_type_class"> <input type="radio"
							name="is_source_type" class="is_source_type_class" value="0"
							checked> 图片
						</label> <label class="source_type_class"> <input type="radio"
							name="is_source_type" class="is_source_type_class" value="1"> 视频
						</label>

						<table class="table table-hover" id="input_table">
							<tr>
								<th>链接</th>
								<th>操作</th>
							</tr>
						</table>
					</div>
					
					<div class="form-group marking-img">
						<label for="mobile">打标图片</label><br/>
					</div><br/><br/>
					<div class="form-group">
						<label for="exampleInputEmail1"><span class="text-danger">* </span>销售状态</label> <select
							id="update_forsale" name="forsale" class="form-control"
							style="width: 50%;">
							<option value="1">可销售</option>
							<option value="0">不可销售</option>
						</select>
					</div>
					<!-- mod by lizenan 20180119 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  start -->
					<!-- <div class="form-group">
						<label for="mobile">系列号</label> <input type="text"
							style="width: 50%;" class="form-control" name="series"
							id="update_series" placeholder="系列号">
					</div> -->
                    <!-- mod by lizenan 20180118 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  end -->
					<div class="form-group">
						<label for="mobile">型号</label> <input type="text"
							style="width: 50%;" class="form-control" name="model"
							id="update_model" placeholder="型号">
					</div>

					<div class="form-group">
						<label for="mobile"><span class="text-danger">* </span>市场价</label> <input type="text"
							style="width: 50%;" class="form-control" name="market_price"
							id="update_market_price" placeholder="市场价">
					</div>

					<div class="form-group">
						<label for="mobile"><span class="text-danger">* </span>销售价</label> <input type="text"
							style="width: 50%;" class="form-control" name="sale_price"
							id="update_sale_price" placeholder="销售价">
					</div>

					<div class="form-group">
						<label for="exampleInputEmail1">上下架</label> <select
							id="update_use_flg" name="use_flg" class="form-control"
							style="width: 50%;">
							<option value="1">上架</option>
							<option value="0">下架</option>
							<option value="2">上架已售罄</option>
						</select>
					</div>
					<input name="check_img_val" type="hidden" id="check_img_val"> <input
						name="update_goods_id" id="update_goods_id" type="hidden">
				</div>
                <?php ActiveForm::end(); ?>
                <div style="display: none">
                    <?php $form = ActiveForm::begin(['id'=>'upload_img_form','action'=>'/common/img-upload'],['options' => ['enctype' => 'multipart/form-data']]) ?>
                    <?= $form->field($model, 'img_url')->fileInput(['class' => 'upload_file']) ?>
                    <?php ActiveForm::end() ?>
                </div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭
				</button>
				<a type="button" class="btn btn-primary ajax_post_update_goods_sku">
					提交 </a>
			</div>
		</div>
	</div>
</div>

<div class="modal fade" id="examine-goods-sku" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<input name="goods_sale_edit_id" id="goods_sale_edit_id" type="hidden"/> 
	<div class="modal-dialog">
		<div class="modal-content examine-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title">审核子商品</h4>
			</div>
			<div class="modal-body">
    			<div class="row">
    				<div class="col-md-6 form-left">
    					<form>
    						<div class="form-group">
								<label for="mobile">商品名称</label>
								<input type="text" style="width: 50%;" disabled class="form-control" id="sale_goods_name">
        					</div>
        					<div class="form-group">
        						<label for="mobile">设为主商品</label>
        						<div class="radio">
        							<label> <input type="radio" name="sale_product" disabled class="is_main_class" value="1"> 是 </label>
        							<label> <input type="radio" name="sale_product" disabled class="is_main_class" value="0"> 否 </label>
        						</div>
        					</div>
        					<div class="form-group">
        						<label for="mobile">物料号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="sku" id="sale_sku" placeholder="物料号">
        					</div>
        					<div class="form-group">
        						<label for="mobile">图片/视频</label>
        						<table class="table table-hover" id="sale_source">
        							<tr>
        								<th>查看</th>
        							</tr>
        						</table>
        					</div>
        					<div class="form-group marking-img-1">
        						<label for="mobile">打标图片</label><br/>
        					</div><br/><br/>
        					<div class="form-group">
        						<label for="exampleInputEmail1">销售状态</label>
        						<select id="sale_forsale" name="forsale" disabled class="form-control" style="width: 50%;">
        							<option value="1">可销售</option>
        							<option value="0">不可销售</option>
        						</select>
        					</div>
                            <!-- mod by lizenan 20180119 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  start -->
        					<!-- <div class="form-group">
        						<label for="mobile">系列号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="series" id="sale_series" placeholder="系列号">
        					</div> -->
                            <!-- mod by lizenan 20180119 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  end -->
        					<div class="form-group">
        						<label for="mobile">型号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="model" id="sale_model" placeholder="型号">
        					</div>
        
        					<div class="form-group">
        						<label for="mobile">市场价</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="market_price" id="sale_market_price" placeholder="市场价">
        					</div>
        
        					<div class="form-group">
        						<label for="mobile">销售价</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="sale_price" id="sale_price" placeholder="销售价">
        					</div>
        
        					<div class="form-group">
        						<label for="exampleInputEmail1">上下架</label>
        						<select id="sale_use_flg" disabled name="use_flg" class="form-control"
        							style="width: 50%;">
        							<option value="1">上架</option>
        							<option value="0">下架</option>
        							<option value="2">售罄</option>
        						</select>
        					</div>
                    	</form>
    				</div>
    				<div class="col-md-6 form-right">
    					<form>
    						<div class="form-group">
								<label for="mobile" class="text-danger">原商品名称</label>
								<input type="text" style="width: 50%;" disabled class="form-control" id="sale_goods_name_2">
        					</div>
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原主商品</label>
        						<div class="radio">
        							<label> <input type="radio" name="sale_product_2" disabled class="is_main_class" value="1"> 是 </label>
        							<label> <input type="radio" name="sale_product_2" disabled class="is_main_class" value="0"> 否 </label>
        						</div>
        					</div>
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原物料号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="sku" id="sale_sku_2" placeholder="物料号">
        					</div>
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原图片/视频</label>
        						<table class="table table-hover" id="sale_source_2">
        							<tr>
        								<th>查看</th>
        							</tr>
        						</table>
        					</div>
        					<div class="form-group marking-img-2">
        						<label for="mobile">原打标图片</label><br/>
        					</div><br/><br/>
        					<div class="form-group">
        						<label for="exampleInputEmail1" class="text-danger">原销售状态</label>
        						<select id="sale_forsale_2" name="forsale" disabled class="form-control" style="width: 50%;">
        							<option value="1">可销售</option>
        							<option value="0">不可销售</option>
        						</select>
        					</div>
        					<!-- mod by lizenan 20180119 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  start -->
        					<!-- <div class="form-group">
        						<label for="mobile" class="text-danger">原系列号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="series" id="sale_series_2" placeholder="系列号">
        					</div> -->
                            <!-- mod by lizenan 20180119 【后台需求】将原本SKU的系列号转移至商品基础资料维护中   469  end -->
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原型号</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="model" id="sale_model_2" placeholder="型号">
        					</div>
        
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原市场价</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="market_price" id="sale_market_price_2" placeholder="市场价">
        					</div>
        
        					<div class="form-group">
        						<label for="mobile" class="text-danger">原销售价</label>
        						<input type="text" style="width: 50%;" disabled class="form-control" name="sale_price" id="sale_price_2" placeholder="销售价">
        					</div>
        
        					<div class="form-group">
        						<label for="exampleInputEmail1" class="text-danger">原上下架</label>
        						<select id="sale_use_flg_2" disabled name="use_flg" class="form-control" style="width: 50%;">
        							<option value="1">上架</option>
        							<option value="0">下架</option>
        							<option value="2">售罄</option>
        						</select>
        					</div>
                    	</form>
    				</div>
    				<div class="col-md-12">
                        <div class="col-md-1"></div>
                        <div class="col-md-10">
                            <button class="btn col-md-3" style="color:#fff;background-color:#df13cd;border-color:#EE00EE" onclick="goodsPreview(this,2)">预览</button>
                            <button class="btn btn-warning col-md-3" onclick="changeExamineSkuStatus(3)">核退</button>
                            <button class="btn btn-primary col-md-3" onclick="changeExamineSkuStatus(2)">核准</button>
                        </div>
                        <div class="col-md-1"></div>
                    </div>
    			</div>
            </div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>
<input name="spec_id" id="spec_id" value="" type="hidden"/>
<input name="class_len" id="class_len" value="0" type="hidden"/>
<input type="hidden" name="imageBathUrl" id="imageBathUrl" value="<?php echo Yii::$app->params['imageBathUrl'] . '/' ?>">
<!-- 固定js -->
<script type="text/javascript" src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="../static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="../static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="../static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="/static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 富文本框插件 -->
<script type="text/javascript" src="/static/plugins/xheditor/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="/static/plugins/xheditor/xheditor_lang/zh-cn.js"></script>
<!-- 图片上传插件 -->
<script type="text/javascript" src="../static/plugins/jquery.form.js"></script>
<!-- 图片显示插件 -->
<script type="text/javascript" src="../static/plugins/layer/layer.js"></script>
<!-- 搜索下拉框 -->
<script type="text/javascript" src="../static/app/goods-keyword/js/jquery.dropdown.js"></script>
<script type="text/javascript" src="../static/app/goods-keyword/js/mock.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="/static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="../static/app/goods/goods.js?version=<?=Yii::$app->params['version']?>"></script>
<script>
    var keyword_data = <?=(is_array($keyword) ? json_encode($keyword) : '')?>;
    //下拉框选择分类，品牌，品类
    var category_child_string = '<?= $category_child_list?>';
    var category_child_list = jQuery.parseJSON(category_child_string);

    var brand_string = '<?= $brand_list?>';
    var brand_list = jQuery.parseJSON(brand_string);

    var tag_string = '<?= $tag_list?>';
    var tag_list = jQuery.parseJSON(tag_string);

    var mark_img = <?=(is_array($mark_img) ? json_encode($mark_img) : '')?>;
    var imageBathUrl = '<?php echo Yii::$app->params['imageBathUrl'] . '/' ?>';

	var nav_identification_list = <?=(is_array($nav_identification_list) ? json_encode($nav_identification_list) : '')?>
</script>